****************************************************************************************** 
****************************************************************************************** 
****************************************************************************************** 
/*

THIS DO-FILE:

1. Prepares data
2. Runs descriptive analyses
3. Constructs input profiles for structural model
4. Constructs data moments for structural estimation

*/
****************************************************************************************** 
****************************************************************************************** 
****************************************************************************************** 

clear all
set more off
set maxvar 10000

global rawdata "E:\Box Sync\HRS"
global rawPSIDdata "E:\Box Sync\PSID\data"

cd "C:\Users\cmommaerts\Dropbox\LTC\Replication"

******************************************************************************************
*GET ASSISTED LIVING AND HELPER INFORMATION FROM RAW HRS
do "get_assisted_living_from_raw_hrs.do"
do "get_helper98.do"
do "get_helper00.do"
do "get_helper02.do"
do "get_helper04.do"
do "get_helper06.do"
do "get_helper08.do"
do "get_helper10.do"
do "get_helper12.do"
do "get_helper14.do"
******************************************************************************************

******************************************************************************************
*GET SOCIAL NETWORK INFORMATION FROM RAW HRS
do "socialnetworks_rawHRS.do"
******************************************************************************************

******************************************************************************************
*GET CHILD ASSETS FROM PSID
do "get_PSID_full_data.do"
do "get_kid_assets_PSID.do"
******************************************************************************************

******************************************************************************************
*GET HRS SAMPLE AND PARENT SAMPLE
do "get_parent_sample.do"
******************************************************************************************

******************************************************************************************
*GET KIDS + OTHER HELPER SAMPLE
do "get_kids_and_helpers_sample.do"
******************************************************************************************

******************************************************************************************
*CREATE LINKED DATASETS
do "create_parent_kid_datasets.do"
******************************************************************************************

******************************************************************************************
*GET IMPUTED CHILD ASSETS TO MERGE ON LATER WHEN NEEDED
do "get_imputed_kid_assets.do"
******************************************************************************************

******************************************************************************************
*TABLES AND FIGURES
do "table1.do"
do "figure1_appendixtables1and2and3and4.do"
do "appendixtable6.do"
******************************************************************************************

******************************************************************************************
*INPUTS FOR MODEL
do "get_input_profiles.do"
do "get_health_and_death_transitions.do"
do "get_variance_covariance_matrix.do"
******************************************************************************************

******************************************************************************************
*DATA MOMENTS
do "get_data_moments.do"
******************************************************************************************




